package org.example.resolver;

import graphql.kickstart.tools.GraphQLMutationResolver;
import lombok.Setter;
import org.example.service.TodoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Setter(onMethod_ = @Autowired)
public class TodoMutationResolver implements GraphQLMutationResolver  {
    public TodoService todoService;
    public boolean addTodo(String content){
        return todoService.addTodo(content);
    }
    public boolean modifyTodoStatus(int id,String status){
        return todoService.modifyTodoStatus(id,status);
    }

    public int removeCompleted(){
        return todoService.removeCompleted();
    }
    public boolean deleteTodo(int id){
        return  todoService.deleteTodo(id);
    }





}
